package org.vsg.stock.core.indicator.kline;

import java.util.List;

import org.vsg.stock.core.indicator.coordinate.OriginalDataPoint;
import org.vsg.stock.core.indicator.coordinate.shape.RelativeEstimatedLineEquation;
import org.vsg.stock.core.indicator.kline.TrendingCycle.Trending;
import org.vsg.stock.core.kline.DailyKLineStock;

/**
 * trending line builder handle , it build the trending line , it also call '通道线'的地线
 * @author Bill Vison
 *
 */
public abstract class TrendingLineBuilder {

	
	/**
	 * handle build running cycle for the stock
	 */
	abstract void buildUp();

	
	/**
	 * defined indicateor import list
	 * @param importedList
	 */
	abstract void setDailyKLineStockList(List<DailyKLineStock> importedList);

	/**
	 * 
	 * @param importedList
	 */
	abstract void setKlineStockInReferedCycle(List<DailyKLineStock> importedList);
	

	/**
	 * defined trending in cycle 
	 */
	private Trending trending;


	protected void setTrendingInReferedCycle(Trending trending) {
		// TODO Auto-generated method stub
		this.trending = trending;
	}
	
	protected Trending getTrendingInReferedCycle() {
		return this.trending;
	}
	
	
	/**
	 * 
	 * @param odp
	 */
	abstract void setOriginalDataPoint(OriginalDataPoint odp);
	
	/**
	 * 
	 * get all the line defined 
	 */
	abstract List<RelativeEstimatedLineEquation> getLines();
	
	
	public static TrendingLineBuilder getInstance(TrendingCycle.Trending trending) {
		
		if ( TrendingCycle.Trending.UPWARD == trending) {
			return new UpwardTrendingLineBuilder();
		}
		else if (TrendingCycle.Trending.DOWNWARD == trending)  {
			return new DownwardTrendingLineBuilder();
		}
		return null;
		
	}

	
	
	
	
}
